<?php
$selected_cat = set_value('role');
$selected_cat_setting = array(
    'table_name' => 'role',
    'key_field' => 'id',
    'value_field' => 'role_name'
);
?>
<?php echo form_open('admin/tao_user', array('id' => 'register')); ?>
<div id="content">
    <?php if ($this->session->flashdata('error')): ?>
        <div class="affiche_erreur">
            <?php echo $this->session->flashdata('error'); ?>
        </div>
    <?php endif; ?>
    <div id="title_content">Tạo User</div>
    <?php echo form_open_multipart('admin/tao_user'); ?>
    <table class="form_content" width="100%">
      
        <tr>
            <td>Họ tên</td>
            <td>
                <?php if (form_error('ho_ten') != "") {
                    ?> <div class="form_error"><?php echo generate_pure_text(form_error('ho_ten'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="text" class="form_input" name="ho_ten" size="35" maxlength="40" value="<?php echo set_value('ho_ten'); ?>" /></td>
        </tr>
      
        <tr>
            <td>Email :</td>
            <td>
                <?php if (form_error('email') != "") {
                    ?> <div class="form_error"><?php echo generate_pure_text(form_error('email'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="text" class="form_input" name="email" size="35" maxlength="40" value="<?php echo set_value('email'); ?>" /></td>
        </tr>

        <tr>
            <td>Mật khẩu</td>
            <td>
                <?php if (form_error('password') != "") {
                    ?> <div class="form_error"><?php echo generate_pure_text(form_error('password'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="password" class="form_input" name="password" size="35" maxlength="40" value="<?php echo set_value('password'); ?>" /></td>
        </tr>
        <tr>
            <td>Nhập lại mật khẩu</td>
            <td>
                <?php if (form_error('confirm_password') != "") {
                    ?> <div class="form_error"><?php echo generate_pure_text(form_error('confirm_password'), '<p>', '</p>'); ?></div> <?php } ?>
                <input type="password" class="form_input" name="confirm_password" size="35" maxlength="40" value="<?php echo set_value('confirm_password'); ?>" /></td>
        </tr>

        <tr>
            <td>Role :</td>
            <td>
                <?php echo form_dropdown('role', dropdown_data($selected_cat_setting), set_value('role')); ?>  
            </td>
        </tr>


        <tr>
            <td colspan="2"><input type="submit" name="submit" value="Tạo mới" class="form_submit" /></td>
        </tr>
    </table>
    <?php echo form_close(); ?>
</div>